package com.mydomain.Bodega;

import com.mydomain.Bodega.*;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityHome;

@Name("invIngresoItemHome")
public class InvIngresoItemHome extends EntityHome<InvIngresoItem> {

	@In(create = true)
	InvIngresoHome invIngresoHome;
	@In(create = true)
	InvItemStockHome invItemStockHome;

	public void setInvIngresoItemDetalleIngreso(Long id) {
		setId(id);
	}

	public Long getInvIngresoItemDetalleIngreso() {
		return (Long) getId();
	}

	@Override
	protected InvIngresoItem createInstance() {
		InvIngresoItem invIngresoItem = new InvIngresoItem();
		return invIngresoItem;
	}

	public void wire() {
		getInstance();
		InvIngreso invIngreso = invIngresoHome.getDefinedInstance();
		if (invIngreso != null) {
			getInstance().setInvIngreso(invIngreso);
		}
		InvItemStock invItemStock = invItemStockHome.getDefinedInstance();
		if (invItemStock != null) {
			getInstance().setInvItemStock(invItemStock);
		}
	}

	public boolean isWired() {
		return true;
	}

	public InvIngresoItem getDefinedInstance() {
		return isIdDefined() ? getInstance() : null;
	}

}
